// FIXME: your file license if you have one
#ifndef ANDROID_HARDWARE_BEARPI_V1_0_H
#define ANDROID_HARDWARE_BEARPI_V1_0_H

#include <vendor/hardware/bearpi/1.0/IBearPi.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <log/log.h>
#include <android/log.h>
#include <hardware/hardware.h>
#include <hardware/bearpi.h>

namespace vendor{
namespace hardware{
namespace bearpi{
namespace V1_0{
namespace implementation {


using ::vendor::hardware::bearpi::V1_0::IBearPi;
using ::vendor::hardware::bearpi::V1_0::IBearPiClientCallback;
using ::vendor::hardware::bearpi::V1_0::BearPiAcquiredInfo;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
using ::android::hardware::hidl_vec;

struct BearPi : public IBearPi {
    // Methods from ::android::hardware::bearpi::V1_0::IBearPi follow.
public:
    BearPi();
    ~BearPi();
    static IBearPi * getInstance();

    Return<uint64_t> setNotify(const sp<IBearPiClientCallback>& callback) override;
    Return<uint64_t> test() override;
    Return<uint64_t> startGetAngle() override;
    Return<uint64_t> stopGetAngle() override;

    // Methods from ::android::hidl::base::V1_0::IBase follow.
private:
    static bear_device_t * openHal();
    static void notify(const bear_msg_t *msg);
    static BearPiAcquiredInfo VendorAcquiredFilter(int32_t error, int32_t* vendorCode);
    static BearPi* sInstance;
    sp<IBearPiClientCallback> mClientCallback;
    bear_device_t *mDevice;

};

// FIXME: most likely delete, this is only for passthrough implementations
// extern "C" IBearPi* HIDL_FETCH_IBearPi(const char* name);

} // namespace implementation
} // namespace V1_0
} // namespace bearpi
} // namespace hardware
} // namespace vendor


#endif
